---------------------------------------------------------------------------------------
# НАСТРОЙКА МОНИТОРОВ
---------------------------------------------------------------------------------------
monitor=eDP-1,1920x1080,0x0,1


plugin {
    hyprbars {
        bar_color = rgba(f9f9f9ff)
        bar_height = 20
        bar_text_color = rgba(272a34ff)
        bar_text_size = 10
        bar_text_font
    }
}


---------------------------------------------------------------------------------------
# АВТОЗАПУСК
---------------------------------------------------------------------------------------
exec-once = hyprpaper
exec-once = waybar


---------------------------------------------------------------------------------------
# ПОДКЛЮЧЕНИЕ ФАЙЛА КОНФИГУРАЦИИ
---------------------------------------------------------------------------------------
# source = ~/.config/hypr/myColors.conf


---------------------------------------------------------------------------------------
# НАСТРОЙКА КЛАВИАТУРЫ
---------------------------------------------------------------------------------------
input {
    kb_layout = us,ru
    kb_variant =
    kb_model =
    kb_options = grp:alt_shift_toggle
    kb_rules =

    follow_mouse = 1

    touchpad {
        natural_scroll = no
    }

    sensitivity = 0 # -1.0 - 1.0, 0 means no modification.
}


---------------------------------------------------------------------------------------
# ГАПСЫ, БОРДЕРЫ, ЦВЕТА...
---------------------------------------------------------------------------------------

general {
    # See https://wiki.hyprland.org/Configuring/Variables/ for more

    gaps_in = 10
    gaps_out = 10
    border_size = 2
    col.active_border = 0xFF35475D
    col.inactive_border = 0xFF141C24
    layout = dwindle
    max_fps=45
}

---------------------------------------------------------------------------------------
# БЛЮРЫ, ТЕНИ, СКРУГЛЕНИЯ
---------------------------------------------------------------------------------------
decoration {
    # See https://wiki.hyprland.org/Configuring/Variables/ for more

    rounding = 8
    multisample_edges = true
    blur = no
    blur_size = 3
    blur_passes = 1
    blur_new_optimizations = on

    #drop_shadow = no
    #shadow_range = 3
    #shadow_render_power = 5
    #col.shadow = rgba(2f343fff)

    # Затемнение неактивных окон
    dim_inactive = 1
    dim_strength = 0.6
}


---------------------------------------------------------------------------------------
# АНИМАЦИЯ
---------------------------------------------------------------------------------------
animations {
    enabled = yes

    bezier = myBezier, 0.05, 0.9, 0.1, 1.05

    animation = windows, 1, 7, myBezier
    animation = windowsOut, 1, 7, default, popin 80%
    animation = border, 1, 10, default
    animation = fade, 1, 7, default
    animation = workspaces, 1, 6, default
}


---------------------------------------------------------------------------------------
# НАСТРОЙКА ПОВЕДЕНИЯ ОКОН
---------------------------------------------------------------------------------------
dwindle {
    # See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more
    pseudotile = yes # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below
    preserve_split = yes # you probably want this
}

master {
    # See https://wiki.hyprland.org/Configuring/Master-Layout/ for more
    new_is_master = 1
    # no_gaps_when_only = true
}


---------------------------------------------------------------------------------------
# ЖЕСТЫ
---------------------------------------------------------------------------------------
gestures {
    # See https://wiki.hyprland.org/Configuring/Variables/ for more
    workspace_swipe = off
}


---------------------------------------------------------------------------------------
# СЦЕНАРИИ ПРИ СТАРТЕ HYPERLAND
---------------------------------------------------------------------------------------
# See https://wiki.hyprland.org/Configuring/Keywords/#executing for more
device:epic mouse V1 {
    sensitivity = -0.5
}


---------------------------------------------------------------------------------------
# ПРАВИЛА ОКОН (hyprctl clients - так можно узнать класс окна)
---------------------------------------------------------------------------------------
# ПРАВИЛА ДИАЛОГОВЫХ ОКОН
windowrule = float, title:Confirm to replace files
windowrule = float, file_progress
windowrule = float, title:File Operation Progress
windowrule = float, confirm
windowrule = float, dialog
windowrule = float, download
windowrule = float, notification
windowrule = float, error
windowrule = float, splash
windowrule = float, confirmreset
windowrule = float, title:Open File
windowrule = float, title:branchdialog


# ПРАВИЛА СОНОВНЫХ ОКОН
windowrule = float, steam
windowrule = float, Lxappearance
windowrule = animation none,Rofi
windowrule = float, viewnior
windowrule = float, pavucontrol
windowrule = idleinhibit fullscreen, firefox


## РАЗМЕЩЕНИЕ ОКОН НА ОПРЕДЕЛЕННЫХ ВОРКСПЕЙСАХ
windowrule = workspace 2, firefox
windowrule = workspace 5, code-oss
windowrule = workspace 8, discord
windowrule = workspace 9, steam
windowrule = workspace 7, telegram


---------------------------------------------------------------------------------------
# ХОТКЕИ
---------------------------------------------------------------------------------------
$mainMod = SUPER

# Глобальные
bind = $mainMod, Q, killactive, 
bind = $mainMod, SPACE, togglefloating, 
bind = $mainMod SHIFT, P, exec, ~/.config/rofi/powermenu/type-2/powermenu.sh


# Запуск софта
bind = $mainMod, RETURN, exec, alacritty
bind = $mainMod, F, exec, Thunar
bind = $mainMod, W, exec, firefox
bind = $mainMod, D, exec, ~/.config/rofi/launchers/type-4/launcher.sh

# Управление фокусом
bind = $mainMod, left, movefocus, l
bind = $mainMod, right, movefocus, r
bind = $mainMod, up, movefocus, u
bind = $mainMod, down, movefocus, d

# Переключение воркспейсов
bind = $mainMod, 1, workspace, 1
bind = $mainMod, 2, workspace, 2
bind = $mainMod, 3, workspace, 3
bind = $mainMod, 4, workspace, 4
bind = $mainMod, 5, workspace, 5
bind = $mainMod, 6, workspace, 6
bind = $mainMod, 7, workspace, 7
bind = $mainMod, 8, workspace, 8
bind = $mainMod, 9, workspace, 9
bind = $mainMod, 0, workspace, 10

# Перемещение окна на другой воркспейс
bind = $mainMod SHIFT, 1, movetoworkspace, 1
bind = $mainMod SHIFT, 2, movetoworkspace, 2
bind = $mainMod SHIFT, 3, movetoworkspace, 3
bind = $mainMod SHIFT, 4, movetoworkspace, 4
bind = $mainMod SHIFT, 5, movetoworkspace, 5
bind = $mainMod SHIFT, 6, movetoworkspace, 6
bind = $mainMod SHIFT, 7, movetoworkspace, 7
bind = $mainMod SHIFT, 8, movetoworkspace, 8
bind = $mainMod SHIFT, 9, movetoworkspace, 9
bind = $mainMod SHIFT, 0, movetoworkspace, 10

# Перемещение и ресайз окон ЛКМ ПКМ + mineMod
bindm = $mainMod, mouse:272, movewindow
bindm = $mainMod, mouse:273, resizewindow

# Перемещение окон с помощтб клавиатуры
bind = $mainMod SHIFT, left, movewindow, l
bind = $mainMod SHIFT, right, movewindow, r
bind = $mainMod SHIFT, up, movewindow, u
bind = $mainMod SHIFT, down, movewindow, d

# СКРИНШОТЫ
bind = $mainMod, PRINT, exec, grim $(xdg-user-dir PICTURES)/Screenshots/$(date +'%Y-%m-%d_%s.png')
bind = $mainMod SHIFT, PRINT, exec, grim -g "$(slurp)" $(xdg-user-dir PICTURES)/Screenshots/$(date +'%Y-%m-%d_%s.png')
bind = $mainMod, K, exec, grim - | wl-copy
bind = $mainMod SHIFT, K, exec, grim -g "$(slurp)" - | wl-copy
